package org.leo.flow.step;

import org.leo.flow.bean.OutData;
import org.leo.flow.flow.IFlow;

/**
 * 
 * Created on 2017年2月9日
 * <p>
 * Description 步骤抽象类
 * <p>
 * Copyright xxx (c) 2019 .
 *
 * @author leo
 */
public abstract class Step implements IStep {

	// private Logger log = LoggerFactory.getLogger(this.getClass());

	/**
	 * 步骤ID
	 */
	private String id;

	/**
	 * 步骤名称
	 */
	private String name;

	private IFlow flow;
	
	private OutData<String, Object> currentOut;

	private IStep nextStep;

	@Override
	public void next(IStep step) {
		this.setNextStep(step);
	}

	public IStep getNextStep() {
		return nextStep;
	}

	private void setNextStep(IStep nextStep) {
		this.nextStep = nextStep;
	}

	public OutData<String, Object> getCurrentOut() {
		return currentOut;
	}

	public void setCurrentOut(OutData<String, Object> currentOut) {
		this.currentOut = currentOut;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getName() {
		if (name == null) {
			name = this.toString();
		}
		return name;
	}

	public Step setName(String name) {
		this.name = name;
		return this;
	}

	public IFlow getFlow() {
		return flow;
	}

	public void setFlow(IFlow flow) {
		this.flow = flow;
	}

}
